home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UUPC11QS.ARJ / TIMESTMP.C < prev    next >
C/C++ Source or Header  |  1991-10-19  |  3KB  |  79 lines

  1. /*--------------------------------------------------------------------*/
  2. /*    timestmp.c                                                      */
  3. /*                                                                    */
  4. /*    Compiler timestamps for display at program start-up             */
  5. /*                                                                    */
  6. /*    History:                                                        */
  7. /*                                                                    */
  8. /*       12/13/89 Add Copyright statements - ahd                      */
  9. /*--------------------------------------------------------------------*/
  10.  
  11. #include <dos.h>
  12. #include <direct.h>
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <io.h>
  16. #include <string.h>
  17.  
  18. #include "lib.h"
  19. #include "timestmp.h"
  20.  
  21. #ifndef UUPCV
  22. #define UUPCV "1.11(experimental)"
  23. #endif
  24.  
  25. char compiled[] = { __DATE__ } ;
  26. char compilet[] = { __TIME__ } ;
  27. char compilev[] = { UUPCV } ;
  28.  
  29. char compilep[] = { "UUPC/extended" } ;
  30.  
  31. void banner (char **argv)
  32. {
  33.       char dummy[FILENAME_MAX];
  34.       char program[FILENAME_MAX];
  35.  
  36. /*--------------------------------------------------------------------*/
  37. /*                 Return if input is not the console                 */
  38. /*--------------------------------------------------------------------*/
  39.  
  40.       if (!isatty(fileno(stdin))) /* Is the console I/O redirected?  */
  41.          return;                 /* Yes --> Run quietly              */
  42.  
  43. /*--------------------------------------------------------------------*/
  44. /*                       Print the program name                       */
  45. /*--------------------------------------------------------------------*/
  46.  
  47. #ifdef __TURBOC__
  48.       if (  fnsplit(argv[0],dummy,dummy, program,dummy) && FILENAME )
  49.       {
  50. #else
  51.       if (!equal(argv[0],"C"))    /* Microsoft C for no prog name? */
  52.       {
  53.          _splitpath( argv[0], dummy , dummy , program , dummy );
  54. #endif /* __TURBOC__ */
  55.          strcpy(argv[0], program);  /* Reset original program name   */
  56.          fprintf(stderr,"%s: ",program);
  57.       } /* if */
  58.  
  59. /*--------------------------------------------------------------------*/
  60. /*    Now print out the version, operating system (MS C only) and     */
  61. /*    timestamp                                                       */
  62. /*--------------------------------------------------------------------*/
  63.  
  64. #ifdef __TURBOC__
  65.       fprintf(stderr,"%s %s (%2.2s%3.3s%2.2s %5.5s)\n",
  66. #else
  67.       fprintf(stderr,"%s for %s %s (%2.2s%3.3s%2.2s %5.5s)\n",
  68. #endif
  69.                   compilep,
  70. #ifndef __TURBOC__
  71.                   (_osmode == DOS_MODE) ? "MS-DOS" : "OS/2",
  72. #endif
  73.                   compilev,
  74.                   &compiled[4],
  75.                   &compiled[0],
  76.                   &compiled[9],
  77.                   compilet);
  78. } /* banner */
  79.